<?php

class tplFormask extends StudyBuddy\Template\Template
{
	/**
	 * Important: names of form fields
	 * must match the keys in this array
	 * for example 'title', 'body', 'tags'
	 * must be names of form fields
	 *
	 * @var array
	 */
	protected static $vars = array(
	'token' => '', //1
	'required' => 'required', //2
	'title' => '', //3
	'title_l' => 'Title', // 4
	'title_d' => 'Enter a descriptive title',
	'title_e' => '', // 6
	'title_c' => 'ask_title', // 7
	'qbody' => '', //8
	'qbody_e' => '', //9
	'tags' => '', //10
	'tags_l' => 'Tags', //11
	'tags_d' => 'At least one tag, max 5 tags separated by comma', //12
	'tags_e' => '', //13
	'submit' => 'Submit', //14
	'com_hand' => '', // 15
	'readonly' => '', // 16
	'disabled' => '', // 17
	'connectBlock' => '', //18
	'formError' => '', //19
	'tags_required' => '', //20
	'socials' => '', //21
	'Preview' => 'Preview', // 22
	'subject' => '', // 23
	'subject_l' => 'Subject', // 24
	'level' => 'Sec 3&4', // 25
	'level_l' => 'Level', // 26
	'chapter' => '', // 27
	'chapter_l' => 'Chapter', // 28
	'dif' => '', // 29
	'dif_l' => 'Difficult' // 30
	); 

	protected static $tpl = '
	<div id="ask_form"  class="form_wrap">
        <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">
                tinyMCE.init({
                        // General options
                        mode : "textareas",
                        theme : "advanced",
						relative_urls : false,
						height : "480",
						object_resizing : false,
                        plugins : "jbimages,autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
//                        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

                        // Theme options
                        theme_advanced_buttons1 : "equation,jbimages",
//                      theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,cleanup,|,equation,|,image",
//                      theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                        theme_advanced_buttons2 : "",
//                      theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                        theme_advanced_buttons3 : "",
//                      theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,equation,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                        theme_advanced_buttons4 : "",
//                      theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
                        theme_advanced_toolbar_location : "top",
                        theme_advanced_toolbar_align : "left",
                        theme_advanced_statusbar_location : "bottom",
                        theme_advanced_resizing : false,

                        file_browser_callback : "ajaxfilemanager",

                        // Example content CSS (should be your site CSS)
                        content_css : "css/content.css",

                        // Drop lists for link/image/media/template dialogs
                        template_external_list_url : "lists/template_list.js",
                        external_link_list_url : "lists/link_list.js",
                        external_image_list_url : "lists/image_list.js",
                        media_external_list_url : "lists/media_list.js",

                        // Style formats
                        style_formats : [
                                {title : "Bold text", inline : "b"},
                                {title : "Red text", inline : "span", styles : {color : "#ff0000"}},
                                {title : "Red header", block : "h1", styles : {color : "#ff0000"}},
                                {title : "Example 1", inline : "span", classes : "example1"},
                                {title : "Example 2", inline : "span", classes : "example2"},
                                {title : "Table styles"},
                                {title : "Table row 1", selector : "tr", classes : "tablerow1"}
                        ],

                        // Replace values for the template plugin
                        template_replace_values : {
                                username : "Some User",
                                staffid : "991234"
                        },

                    custom_elements: "m",
                    extended_valid_elements: "m"
                });
                
        </script>
	<div class="form_error">%19$s</div>
		<form class="qa_form" name="qaForm" method="POST" action="/index.php" accept-charset="utf-8">
		<input type="hidden" name="a" value="ask">	
		<input type="hidden" name="token" value="%1$s">
		%18$s
                
                <div class="form_el"> 
                    <label for="id_level">%26$s</label><br> 
                    <select name="level">
                        <option value="1">%25$s</option>
                    </select>
                </div>
                
                <div class="form_el"> 
                    <label for="id_subject">%24$s</label><br> 
                    <select name="subject" onchange="oSL.getChapter(this.options[this.selectedIndex].value)">
                        <option value="">Select Subject</option>
                        %23$s
                    </select>
                </div>
                
                <div class="form_el"> 
                    <label for="id_chapter">%28$s</label><br> 
                    <div id="chapter_container">
                        <select name="chapter">
                            <option value="">Select Chapter</option>
                            %27$s
                        </select>
                    </div>
                </div>
                
                <div class="form_el"> 
                    <label for="id_subject">%30$s</label><br> 
                    <select name="dif">
                        <option value="">%30$s</option>
                        %29$s
                    </select>
                </div>
                
		<div class="form_el"> 
                <label for="id_title">%4$s</label> <span class="f_err" id="title_e">%6$s</span><br> 
                <input autocomplete="off" id="id_title" class="title_c%15$s" type="text" name="title" size="80" value="%3$s" %16$s> 
                <div id="title_d" class="caption">%5$s</div> 
       </div>
       <!-- // el title -->
            <div id="similar_questions"></div> 
            <div class="form_el"> 
                <textarea id="id_qbody" rows="6" cols="40" class="com_body%15$s" name="qbody" %16$s>%8$s</textarea>
                <span class="f_err fl cb" id="qbody_e">%9$s</span>
                <!-- <div id="body_preview"></div>
                <span class="label">%22$s</span>
                <div id="tmp_preview"></div> -->
            </div>
            <!-- // el body -->
            
            <div class="form_el"> 
            	<label for="id_tags">%11$s</label> %20$s <span class="f_err"  id="tags_e">%13$s</span><br> 
                <input id="id_tags" type="text" name="tags" class="tags_c%15$s" size="80" value="%10$s" %16$s>  
            	<div id="tags_d" class="caption">%12$s</div> 
            </div>
            <!-- // el tags -->
            <div class="fl cb socials">
            %21$s
            </div>
            <div class="form_el">
            	<input id="dostuff" name="submit" type="submit" value="%14$s" %17$s class="btn btn-m"> 
            </div>
            <!-- // el submit -->
		</form>
	</div>';
}
